package com.santu.edu.supporter.interceptor;

/**
 * @author luoyaoqi
 * @createTime 2024/4/23
 * @description
 */
public class ResponseData<T> {
    int code = 200;
    T data;
    String msg = "成功";

    public ResponseData() {
    }

    public ResponseData(T data) {
        this.data = data;
    }

    public ResponseData(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ResponseData<Object> success(Object t) {
        return new ResponseData(t);
    }

    public static ResponseData<Object> error(int code, String msg) {
        return new ResponseData(code, msg);
    }


    public int getCode() {
        return this.code;
    }

    public T getData() {
        return this.data;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setData(T data) {
        this.data = data;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


}